import request from '@/utils/request';

/**
 * 保存机构用户
 * @param {*} params
 */
export const save = params => {
  return request({
    url: '/admin/org/user/save',
    data: params,
    method: 'post'
  });
};

/**
 * 删除机构信息
 * @param {*} id
 */
export const remove = id => {
  return request({
    url: '/admin/org/user/delete',
    data: {
      id: id
    },
    method: 'post'
  });
};

/**
 * 分页查询机构用户信息
 * @param {*} params
 */
export const findOrgUserPage = params => {
  return request({
    url: '/admin/org/user/findOrgUserPage',
    data: params,
    method: 'post'
  });
};

/**
 * 分页查询用户信息
 * @param {*} params
 */
export const findOrgRelUserPage = params => {
  return request({
    url: '/admin/org/user/findOrgRelUserPage',
    data: params,
    method: 'post'
  });
};

/**
 * 查询部门下是否还有用户
 * @param {*} params
 */
export const checkOrgRelUser = params => {
  return request({
    url: '/admin/org/user/checkOrgRelUser',
    data: {
      id: params
    },
    method: 'post'
  });
};
